home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / getStandardWindow.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.5 KB  |  117 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. //  Alias|Wavefront Script File
  19. //  MODIFY THIS AT YOUR OWN RISK
  20. //
  21. //  Creation Date:  November 6, 1996
  22. //  Author:         mm
  23. //
  24. //  Description:
  25. //      This script defines the appearance for option box dialogs
  26. //
  27. //  Input Arguments:
  28. //      string $optionBoxTitle    The title of the option box dialog
  29. //        int $numPages            The number of pages that this dialog
  30. //                                will display
  31. //        string $options            Options for this dialog
  32. //                                Option words are specified within the
  33. //                                the string, with each option seperated
  34. //                                by a space (e.g. "noScroll otherOption")
  35. //
  36. //            Current options:
  37. //                noOptions        A nice "do nothing" string to pass
  38. //                noScroll        Make the tabLayout non-scrollable
  39. //
  40. //  Return Value:
  41. //      string[] where:
  42. //            [0]        Name of the window
  43. //            [1]        Name of the formLayout
  44. //            [2]        Name of the tabLayout
  45. //            [3]        Name of the help menu item
  46. //        Note: add new return names below here
  47. //
  48. global proc string[]
  49. getStandardWindow (string $optionBoxTitle, int $numPages, string $options)
  50. {
  51.     //    Global variables... from getOptionBox
  52.     //
  53.     global string $gOptionBox;
  54.     global string $gOptionBoxTabLayout;
  55.     global string $gOptionBoxApplyBtn;
  56.     global string $gOptionBoxResetBtn;
  57.     global string $gOptionBoxCloseBtn;
  58.     global string $gOptionBoxSaveBtn;
  59.  
  60.     global int $gStandardWindowWidthIndex;
  61.     string $widgetList[4];
  62.  
  63.     // Get the new standard option box
  64.     //
  65.     string $optionBoxTab = getOptionBox();
  66.  
  67.     string $optionBoxName = $gOptionBox;
  68.     string $topLayoutName = "BoxLayout";
  69.  
  70.     // See if the option box window already exists
  71.     //
  72.     if ( `window -exists $optionBoxName` ){
  73.  
  74.         // It exists.
  75.         //
  76.         $widgetList[0] = $optionBoxName;
  77.  
  78.         // Put the new title on it
  79.         //
  80.         setOptionBoxTitle ($optionBoxTitle);
  81.  
  82.         // Create the new top level layout
  83.         //
  84.         setParent $optionBoxName;
  85.         setParent $optionBoxTab;
  86.         $widgetList[1] = `formLayout $topLayoutName`;
  87.         // Get rid of the old content; add in the new layout
  88.         //
  89.         setParent $widgetList[1];
  90.     } else {
  91.         error -showLineNumber 1 "Option Box window does not exist.";
  92.     }
  93.  
  94.     $widgetList[2] = `tabLayout
  95.         -scrollable (match ("noScroll", $options) == "")
  96.         -minChildWidth 100
  97.         -childResizable true`;
  98.     if ($numPages < 2) {
  99.         tabLayout -edit
  100.             -tabsVisible false
  101.             $widgetList[2];
  102.     }
  103.     formLayout -edit
  104.         -attachForm $widgetList[2] "top"    0
  105.         -attachForm $widgetList[2] "left"   0
  106.         -attachForm $widgetList[2] "bottom" 0
  107.         -attachForm $widgetList[2] "right"  0
  108.         $widgetList[1];
  109.  
  110.     $widgetList[3] = getOptionBoxHelpItem();
  111.     menuItem -edit
  112.         -label "Help with "
  113.         $widgetList[3];
  114.  
  115.     return ($widgetList);
  116. }
  117.